#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <math.h>
int main()
{
    int i = 0;
    int T = 0;
    scanf("%d", &T);
    for (i = 0; i < T; i++)
    {
        int m = 0;
        int flag = 1;
        scanf("%d", &m);
        int n = 0;
        for (n = 2; n < sqrt(m); n++)
        {
            if (m % n == 0)
            {
                printf("no\n");
                flag = 0;
                break;
            }
        }
        if (flag == 1)
        {
            printf("yes\n");
        }
    }
    return 0;
}